let mongoose = require("mongoose");
let ScreenModel = require("./ScreenModel.js")
let cinemasSchema = new mongoose.Schema({
    cinemasName : {
        type : "String",
        require : true,
        trim : true
    },
    cinemasAddr : {
        type : "String",
        require : true,
        trim : true
    },
    cinemasTel : {
        type : "String",
        minlength:9,
        maxlength:11,
        require : true,
        unique : true,
        trim : true
    },
    cinemasUrl : {
        type : "String",
        default: "https://www.maoyan.com/",
        trim : true
    },
    screen:{
        type:ScreenModel,
        enum:ScreenModel
    }
},{versionKey:false})

 module.exports = new mongoose.model("cinemaModel",cinemasSchema,"cinema");
